package com.tuomaxu.core;

import com.tuomaxu.config.Configuration;
import com.tuomaxu.utils.XmlConfigBuilder;

import java.io.InputStream;

public class SqlSessionFactoryBuilder {
    public SqlSessionFactory build(InputStream inputStream) throws Exception {
        XmlConfigBuilder xmlConfigBuilder = new XmlConfigBuilder();
        Configuration configuration = xmlConfigBuilder.parseConfig(inputStream);
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryImp(configuration);
        return  sqlSessionFactory;
    }
}
